< previous page page_324 next page >

Page 324
By setting a breakpoint
By pressing F8 to run the program
Examples Filename: Debug1.frm
EXERCISE
Stepping Through Your Code
1. Select Tools, Options from the Visual Basic menu.
2. Select the Project tab from the Options window.
3. Select the frmDebug1 as the startup form.
4. Click the OK button.
5. Press F8 to begin the process. You should see a code window that looks like the one shown in Figure 16.2.
6. Press F8 to execute the next line of code. Continue to press F8 to execute each subsequent line of code.
7. When you get to a point where a form is displayed, you wont see any more code.
8160-0324a.gif
Figure 16.2
The frmDebug1 form showing a global variable.
analysis.gifYou will use the F8 key quite often as you debug your application.

9f31265bb40b592b1929e18a47ab28e5.gif
NOTE
When a form is displayed, your code is no longer running. Instead, Visual Basic is just waiting for an event to happen. If you click one of the controls in which you have written code, you will be placed into break mode after you click.
Now that you know how to start a program in break mode, lets look at all the different things you can do while in break mode.

 
< previous page page_324 next page >

If you like this book, buy it!